<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: 凡人
  Date: 2021/12/3
  Time: 10:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>title</title>
    <link href="${pageContext.request.contextPath}/static/css/bootstrap4.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/static/js/jquery-3.2.1.js" rel="script"></script>
    <script src="${pageContext.request.contextPath}/static/js/bootstrap-treeview.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/bootstrap.js" rel="script"></script>
    <script src="${pageContext.request.contextPath}/static/My97DatePicker/WdatePicker.js" rel="script"></script>
</head>
<body>
<form action="./list" method="post">
    出库单号:<input type="text" name="id" value="${d.id}">
    <select name="field1">
        <option value="">请选择</option>
        <option value="order_date" ${d.field1=="order_date"?'selected':''}>出库时间</option>
        <option value="prepared_date" ${d.field1=="prepared_date"?'selected':''}>制单时间</option>
    </select>
    <input type="text" readonly="readonly" onclick="WdatePicker()" name="startDate" value="<fmt:formatDate value="${d.startDate}" pattern="yyyy-MM-dd"></fmt:formatDate> "> 至
    <input type="text" readonly="readonly" onclick="WdatePicker()" name="endDate" value="<fmt:formatDate value="${d.endDate}" pattern="yyyy-MM-dd"></fmt:formatDate>">
    备注:<input type="text" name="content" value="${d.content}"><br><br>
    <select name="field2">
        <option value="">请选择</option>
        <option value="clientid" ${d.field2=="clientid"?'selected':''}>客户单号</option>
        <option value="sendid" ${d.field2=="sendid"?'selected':''}>发货单号</option>
    </select>
    <input type="text" name="msg1" value="${d.msg1}">
    总金额:<input type="text" name="startPrice" value="${d.startPrice}"> 至
    <input type="text" name="endPrice" value="${d.endPrice}">
    排序:
    <a href="javascript:void(0)" onclick="rank1('order_date')">出库日期</a>
    <a href="javascript:void(0)" onclick="rank1('order_price')">总金额</a>
    <input type="hidden" name="rank" value="${d.rank}">
    <input type="hidden" name="field" value="${d.field}">
    <input type="button" value="搜索" onclick="goPage(1)">
</form>
<table class="table">
    <thead>
    <tr>
        <th scope="col">序号</th>
        <th scope="col">出库日期</th>
        <th scope="col">出库单号</th>
        <th scope="col">总金额</th>
        <th scope="col">制单人工号</th>
        <th scope="col">制单人</th>
        <th scope="col">制单时间</th>
        <th scope="col">客户单号列表</th>
        <th scope="col">发货单号列表</th>
        <th scope="col">附件</th>
        <th scope="col">备注</th>
        <th scope="col">操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach var="i" items="${list.list}" varStatus="j">
        <tr>
            <td>${j.index+1}</td>
            <td>
                <fmt:formatDate value="${i.orderDate}" pattern="yyyy-MM-dd"></fmt:formatDate>
            </td>
            <td>${i.id}</td>
            <td>${i.orderPrice}</td>
            <td>${i.preparedId}</td>
            <td>${i.preparedBy}</td>
            <td>
                <fmt:formatDate value="${i.preparedDate}" pattern="yyyy-MM-dd"></fmt:formatDate>
            </td>
            <td>${i.clientid}</td>
            <td>${i.sendid}</td>
            <td>
                <img src="${i.image}" width="50px" height="50px">
            </td>
            <td>${i.content}</td>
            <td>

            </td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="100">
            <jsp:include page="/static/common/pages.jsp"></jsp:include>
        </td>
    </tr>
    </tbody>
</table>
</body>
<script>
    //排序
    function rank1(src){
        var i = $('[name="rank"]').val()%2+1;
        $('[name="rank"]').val(i);
        $('[name="field"]').val(src);
        goPage(1);
    }
</script>
</html>
